package com.example.Sao.MyReceiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.example.Sao.MyActivity.MainActivity;
import com.example.Sao.Serivce.SerialPortService;

public class BootBroadcastReceiver extends BroadcastReceiver {
	static final String ACTION = "android.intent.action.BOOT_COMPLETED";
	@Override
	public void onReceive(Context context, Intent intent) {
		Log.v("BootBroadcastReceiver", intent.getAction());
         if(intent.getAction().equals(ACTION)){
         Intent mainActivityIntent =new Intent(context, MainActivity.class);
           mainActivityIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
          context.startActivity(mainActivityIntent);
        }
	}

}
